UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nlOHzNdsxLZtx1lOtBKw64sXF2/B4JVTtlwknWIE8Vg=' 
WHERE 
  key_id = 'c7638a9dd58d3bcad94c10c6fa1c1f429889cf717ebb2fcc1f25480e60685afe' 
  AND (
    token = 'nlOHzNdsxLZtx1lOtBKw64sXF2/B4JVTtlwknWIE8Vg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035