UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4V3E2LQDPp1xdtGhwhipEE+poGIYdLw4VOnryP49I+E='
WHERE
key_id = 'ff22d02dd55910ff1f974bed0cbc9da2c1641b123ba677427bd905aa8cbf8f25'
AND (
token = '4V3E2LQDPp1xdtGhwhipEE+poGIYdLw4VOnryP49I+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)