UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XA1w+SHqhq1sVHmU+J6WOxG/McxEIwRCukDIxB9qpqs='
WHERE
key_id = '924fc303b499751e05246c093d53a51abd199d7b20a0581a23fd01f43be9ed6b'
AND (
token = 'XA1w+SHqhq1sVHmU+J6WOxG/McxEIwRCukDIxB9qpqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)