UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C5Nh/w0BTqK4EPTJJdjKzlhgCSBNBEq8Q4C4aAKjNLA='
WHERE
key_id = 'c32f9fef7dd710c5cf3569253c7873fe29275bc15d9c4a0f03357c999ca97747'
AND (
token = 'C5Nh/w0BTqK4EPTJJdjKzlhgCSBNBEq8Q4C4aAKjNLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)