UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yNU9UUFQHKn7QnXBaDYEMPgwxTikNlZde1hYdQh7BPQ='
WHERE
key_id = '0927d99f6feba3869b90c8c4324256bda6824c1d4e684b7b4fa36d80a8bce162'
AND (
token = 'yNU9UUFQHKn7QnXBaDYEMPgwxTikNlZde1hYdQh7BPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)