UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EOTQwfBUqo2k1LY7Bwi7+NgD1eyZd8OA6Vj/8mOEn8o='
WHERE
key_id = '604ee4257ef0591ae039aca50e434b439e726496b146f92e0086844aedaf6e9a'
AND (
token = 'EOTQwfBUqo2k1LY7Bwi7+NgD1eyZd8OA6Vj/8mOEn8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)