UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YySw6tlNwLz8qRdqBZ7VCNauZYku5N9OWz/pEYR2rp8='
WHERE
key_id = '263f41b0fa2ff0ddf6a8324f000b4ace2a3b1f8faa167ac81ed04073f94480d4'
AND (
token = 'YySw6tlNwLz8qRdqBZ7VCNauZYku5N9OWz/pEYR2rp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)