UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XwNN43jfh/bk/maOEnOgTy9nMENKmzakWaOOqmIsgFw=' 
WHERE 
  key_id = '5594999dc88f2e776d4630225512f62ffc77b3bccd94855293b666783ed77d80' 
  AND (
    token = 'XwNN43jfh/bk/maOEnOgTy9nMENKmzakWaOOqmIsgFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017