UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ng/OfdfchCkHk1bNs9/R0n0exKKuA4YgWsESSh41z0=' 
WHERE 
  key_id = 'b80a3fc4f5da9c5b0f86832a86001fe1a8f53c2815a43bf72073a496b95b0ae8' 
  AND (
    token = '4ng/OfdfchCkHk1bNs9/R0n0exKKuA4YgWsESSh41z0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021