UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BQOc/Dc/gblEmUN2impkMROIsqPuZdNBHw11lnwS3uw='
WHERE
key_id = 'a2a85b5e81a6a87aa1f1e0265450468ee6277eb440c069477b395dd501380968'
AND (
token = 'BQOc/Dc/gblEmUN2impkMROIsqPuZdNBHw11lnwS3uw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)