UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a+VhbUFY9NxiJ4gOK7+yOaWsnoUzSeeqw+2vJdbFoHk=' 
WHERE 
  key_id = '06606c9ce25f9a979ef281b240fb1ba8fa18d5bd0f4ef9c60ec228b16255326c' 
  AND (
    token = 'a+VhbUFY9NxiJ4gOK7+yOaWsnoUzSeeqw+2vJdbFoHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037