UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7aAUFKR2ccxoc4odu6dcwmDVqIDV/ai7SQFqWjxBnQ4=' 
WHERE 
  key_id = 'bffd6b837e35a629be1b010d3d0e527f08ac2ce15f12d74924ce78a3e8c1e365' 
  AND (
    token = '7aAUFKR2ccxoc4odu6dcwmDVqIDV/ai7SQFqWjxBnQ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039