UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IgVRxObvolzM5qScBgt+unaNtcbWA4w2tb2KWtLPjRY='
WHERE
key_id = 'e0f546a4a76ad8ba59d4af27cea6e8d008b1ce18da049070b6280c9535e2b1bb'
AND (
token = 'IgVRxObvolzM5qScBgt+unaNtcbWA4w2tb2KWtLPjRY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)