UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6VcQBX7aQsPQ3NZmZZrM1pj/3kjM47HSws+sTSeGEks=' 
WHERE 
  key_id = '2a075ed51592b53b9fa26cc27e1c2a71c2ac5e3623e21508e6e9fadac9f4f901' 
  AND (
    token = '6VcQBX7aQsPQ3NZmZZrM1pj/3kjM47HSws+sTSeGEks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023