UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WmTdxsU8Y7KWlcBnXzpIhICLciTN4NDCXJ9qInYVfoY='
WHERE
key_id = '63ca733c2ed732f0a141cb7715f1b0571af95d8a8b9481059d4f84ab16ea7f38'
AND (
token = 'WmTdxsU8Y7KWlcBnXzpIhICLciTN4NDCXJ9qInYVfoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)