UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ePy6YBAQICUjZ2LPTht3Otmt/d9OnGhwQfFdtp8aqy8='
WHERE
key_id = '2e5a3f3c9df3aff43c96c273623d749d2458bd6d5b2a089df4e6d7037a9b13c9'
AND (
token = 'ePy6YBAQICUjZ2LPTht3Otmt/d9OnGhwQfFdtp8aqy8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)