UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Sq3D1r5/uO2TLIcvuZXjYgeu3xCFxldN4PAxitquJU='
WHERE
key_id = '40aba4e6ec4cbef448b6d34a99494881c63fa990a85ff4ef428692ebfc9f5172'
AND (
token = '7Sq3D1r5/uO2TLIcvuZXjYgeu3xCFxldN4PAxitquJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)