UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EKsk49o/zOPh3GueAu3s60xV/iuW8RXP43f8qnSl9Lk='
WHERE
key_id = '9ab98d77a1c6d5eaad94c7f6376f609bb054d5f9084ee751d2ddd1bdb03a8f20'
AND (
token = 'EKsk49o/zOPh3GueAu3s60xV/iuW8RXP43f8qnSl9Lk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)