UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LWgWQMBEPiIPQ0qSi5EgZKOYDHaLffpPDswMXxnOIDA='
WHERE
key_id = 'c18a0ac63f3b967960fe8e7c57bf7ebb6f5a35af11454c49ac1b00e63a246f3d'
AND (
token = 'LWgWQMBEPiIPQ0qSi5EgZKOYDHaLffpPDswMXxnOIDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)