UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7cFvhsoGml7NagkTYKvJYt9ep7EzMRdLYTyowuoCs/E='
WHERE
key_id = 'ca682cc25c204661efd3950f6d1869bcffbaa162d1c2648ff206224332730ad6'
AND (
token = '7cFvhsoGml7NagkTYKvJYt9ep7EzMRdLYTyowuoCs/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)