UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GEYkqTdrmAxdUaKb8TvlwwxGg6GEPJBLBYkMn+ZPaf8='
WHERE
key_id = 'e2dbcf0395fba796912dd01e8ed6a6a51bae540fadf101a791337f28f9a14c61'
AND (
token = 'GEYkqTdrmAxdUaKb8TvlwwxGg6GEPJBLBYkMn+ZPaf8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)