UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ker7WD0mMDQHHEL9OXFdPN9p33cohoJlo0y6B3I9NFw=' 
WHERE 
  key_id = 'e9d3d2f9223898cd8ef637ea5a6c1129cfafcd1cef09c1c4087488d6e484918e' 
  AND (
    token = 'Ker7WD0mMDQHHEL9OXFdPN9p33cohoJlo0y6B3I9NFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049