UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zqM/8zdcYE/sEdR7ckPr5LeAhEKAI7U9kRUGzmeU8pg='
WHERE
key_id = 'f7156bcb94de1994a87ff4e235e790aec9e6dc57658de7df68a5c955da0403ae'
AND (
token = 'zqM/8zdcYE/sEdR7ckPr5LeAhEKAI7U9kRUGzmeU8pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)