UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WpoZqlDLtzVYMQ4pGBeSDAtVyz24dKUpAkfReSHOEh0='
WHERE
key_id = '17fc95db7823b24821ae4bceb06fc99b4633ac53658a4cfd79b970e9cd1e28ce'
AND (
token = 'WpoZqlDLtzVYMQ4pGBeSDAtVyz24dKUpAkfReSHOEh0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)