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