UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oWMsu6iZtBH9mgSr/Kk4V6h/CWheKQF3LrszFK6bS+0='
WHERE
key_id = '0815e78f9539a2a02277cbdd74a2f58bac1e640a68b68f58c712be1798103939'
AND (
token = 'oWMsu6iZtBH9mgSr/Kk4V6h/CWheKQF3LrszFK6bS+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)