UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pYrwHnQefN7dNXbNJu3SLnGMGYt1G4T50tU0EGFlOls=' 
WHERE 
  key_id = '32e38bf8f747fa8d4f589a2cea0bd8fbc1479a8bdc1c7e16b7bc0494a4755edc' 
  AND (
    token = 'pYrwHnQefN7dNXbNJu3SLnGMGYt1G4T50tU0EGFlOls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021