UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NxTEkVILggYdDZirEi3fSzP4cxnXo3j9bxQ/wubXKFY='
WHERE
key_id = '07e02c5ac0d3888c146c92d2c632518c45612fafc842544e49c5551dcf7f73a5'
AND (
token = 'NxTEkVILggYdDZirEi3fSzP4cxnXo3j9bxQ/wubXKFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)