UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Oxe6tB6FTsA9F4oCqbj+Uhu2/i84JgGeixq94EdW0g='
WHERE
key_id = '05885f13e6cc2c3753c914e5c2944de5218eb4916d54c2069b193d795073bf3c'
AND (
token = '0Oxe6tB6FTsA9F4oCqbj+Uhu2/i84JgGeixq94EdW0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)