UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FcT/IyRNPJknfqLljJFzqr0qvppGCSGKL6bOWukdQWE='
WHERE
key_id = 'a27875dc89e455e69f6f0b3bc903ab18cc60a8d468ca9c18935c4083d1c08384'
AND (
token = 'FcT/IyRNPJknfqLljJFzqr0qvppGCSGKL6bOWukdQWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)