UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8DOlfyvUnSLty7SCkmcPV6bLjrlwhzFq29JH8Iws3WU='
WHERE
key_id = 'ae1c24fb97ba4c0f9141d917a59f686808791a0ec88ee7058d3800203d3cfe0b'
AND (
token = '8DOlfyvUnSLty7SCkmcPV6bLjrlwhzFq29JH8Iws3WU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)