UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uXK0QFub9eyEgxEry4GxtkfKtR1bPJxhx9LqTetPGB0='
WHERE
key_id = '9c6915dbebd290b14f05d6e8587085de6afa508a631c7b8f8251960a0f15ce45'
AND (
token = 'uXK0QFub9eyEgxEry4GxtkfKtR1bPJxhx9LqTetPGB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)